package esiag.pds.Test;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javolution.util.FastList;

import junit.framework.Assert;

import org.junit.Test;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

import esiag.pds.beans.Information;
import esiag.pds.beans.Parameters;
import esiag.pds.contextManagement.Context;
import esiag.pds.receivers.ReplicationReceiver;

public class TestCrashOfServer {


	@Test
	public void testReplicationClient(){

int nb=0;
		 XmlBeanFactory factory=new XmlBeanFactory(new ClassPathResource("Parameters.xml"));
		 Parameters param=factory.getBean("parameters",Parameters.class);
        ReplicationReceiver rr=new ReplicationReceiver(param.getPort());
		try{
			
			nb=rr.start(param.getReplicationFrequency());
			}catch(Exception e){
				    Assert.assertTrue(rr.getContext().getNbList()==4);
			}
	}
	

}
